package com.gouzheng.service.impl;

import com.gouzheng.dao.paperDao;
import com.gouzheng.entity.Answerinfo;
import com.gouzheng.entity.Paper;
import com.gouzheng.entity.Topic;
import com.gouzheng.service.paperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("paperService")
public class paperServiceImpl implements paperService {

    @Autowired
    private paperDao paperDao;

    @Override
    public List<Paper> getPaperAll(String paperName) {
        return paperDao.getPaperAll(paperName);
    }

    @Override
    public List<Topic> getTopic(Integer paperId) {
        return paperDao.getTopic(paperId);
    }

    @Override
    public List<Paper> getStu(Integer deleteFlag) {
        return paperDao.getStu(deleteFlag);
    }

    @Override
    public void addPaper(Paper paper) {
        paperDao.addPaper(paper);
    }

    @Override
    public void addTopic(Topic topic) {
        paperDao.addTopic(topic);
    }

    @Override
    public Topic selectTopic(Integer paperId, Integer titleNumber) {
        return paperDao.selectTopic(paperId,titleNumber);
    }

    @Override
    public void updateTopic(Topic topic) {
        paperDao.updateTopic(topic);
    }

    @Override
    public void deleteTopic(Integer paper, Integer titleNumber) {
        paperDao.deleteTopic(paper,titleNumber);
    }

    @Override
    public Integer findCountTopic(Integer paperId) {
        return paperDao.findCountTopic(paperId);
    }

    @Override
    public Paper findId(Integer paperId) {
        return paperDao.findId(paperId);
    }

    @Override
    public void linePaper(Integer deleteFlag,Integer paperId ) {
        paperDao.linePaper(deleteFlag,paperId);
    }

    @Override
    public void addAnswerInfo(Answerinfo answerinfo) {
        paperDao.addAnswerInfo(answerinfo);
    }

//    @Override
//    public void deletePaper(Integer paperId) {
//        paperDao.deletePaper(paperId);
//    }
}
